import http from "@/http/index.ts"
import {BomForm,BomListParam} from '@/api/bom/type.ts'


// 新增BOM
export const addApi = (data: BomForm) => {
    return http.post("/bom/createBom", data)
}


// 编辑bom
export const editApi = (data: BomForm) => {
    return http.post("/bom/updateBom", data)
}



// 分页条件查询列表
export const getListApi = (data:BomListParam) => {
    return http.get("/bom/getBomList",data)
}

// 根据bom的id查询bom详情信息
export const getBomDetailByIdApi = (id:number) => {
    return http.get(`/bom/bomDetailById/${id}`,)
}

// 根据bom的code查询bom详情信息
export const getBomDetailByCodeApi = (code:string) => {
    return http.get(`/bom/bomDetailByCode/${code}`,)
}

// 根据bom的编码查询组成结构
export const getBomStructure = (bomCode: string) => {
    return http.get(`/bom/bomStructure/${bomCode}`,)
}


// 删除bom
export const deleteApi = (id: number) => {
    return http.delete(`/bom/deleteBom/${id}`)
}




